package Exp_3;

import java.util.Scanner;

public class Test {
    public static void main(String[] args) throws Exception {
        Scanner scanner = new Scanner(System.in);
        MGraph mGraph = new MGraph();
        mGraph.createGraph();
        System.out.println("你想输出第几个结点的临界点：");
        int v = scanner.nextInt();
        System.out.print("第一个临接点为："+mGraph.firstAdjVex(v));
        System.out.println("第二个临接点为："+mGraph.nextAdjVex(v,0));
        System.out.println("请输入你想获得度数的顶点：");
        int w = scanner.nextInt();
        System.out.println(mGraph.sum(w));
        System.out.println("图的广度优先序列为：");
        mGraph.BFSTraverse(mGraph);
        System.out.println();
        System.out.println("图的深度优先序列为：");
        mGraph.DFSTraverse(mGraph);
    }
}

